package bid.yanhj.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author yanhaijiang
 *
 */

@Controller
@ResponseBody
//@RequestMapping("/hello")
public class HelloController {

    @RequestMapping(value = "/sayhello")
    public String say() {
        return "say hello ....";
    }

    @RequestMapping(value = "/hello")
    public String hello() throws Exception {
        throw new Exception("发生错误");
    }

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public String login() {
        return "login";
    }
}